<form action="${ctx}/platrole/authorization" method="post" enctype="multipart/form-data" id="authorizationForm">
	<input type="hidden" name="roleId" value="${roleId!}" />
	<div id="menuBox0">
	<#list firstLevelMenuList as menu>
		<div class="form-group form-inline row">
			<div class="col-sm-12" id="menuBox${menu.menuId}">
				<label ondblclick ="checkAll(${menu.menuId})">${menu.menuName}：</label>
				<#list secondLevelMenuMap["${menu.menuId}"] as childMenu>
					<#if authorityMenuIdSet?seq_contains(childMenu.menuId)>
						<label><input type="checkbox" class="minimal"  name="menuId" value="${childMenu.menuId}" checked>&nbsp;&nbsp;${childMenu.menuName}</label>
					<#else>
						<label><input type="checkbox" class="minimal" id="menuId${menu.menuId}" name="menuId" value="${childMenu.menuId}">&nbsp;&nbsp;${childMenu.menuName}</label>
					</#if>
				</#list>
			</div>
		</div>
	</#list>
</div>
</form>
<script>
  $(function () {
	  $('input[type="checkbox"].minimal').iCheck({
	      checkboxClass: 'icheckbox_minimal-blue'
      });
  })
  function checkAll(menuId) {
      var checkAll=$("#menuBox"+menuId+" :checked").length;
      var defaultAll=$("#menuBox"+menuId+" :checkbox").length;
      if(checkAll==defaultAll){
          $("#menuBox"+menuId+" :checkbox").prop("checked", false);
	  }else{
          $("#menuBox"+menuId+" :checkbox").prop("checked", true);
	  }
  }
</script>